package top.wardyan.sqlchecker.po;

import java.io.File;
import java.sql.Timestamp;
import java.util.List;

import cn.hutool.core.io.file.FileReader;
import top.wardyan.sqlchecker.model.YTSqlCheckerItem;
import top.wardyan.sqlchecker.model.YTSqlfile;

/**
 * 读取文件出来时就自动去掉多行注释内的内容
 * @author harrydeep@wardyan.top
 * 2025-02-08
 */
public class WSqlFile {

	private static final cn.hutool.log.Log log = cn.hutool.log.Log.get();
	
	
	/** save之后才有 **/
	Integer id;
	String md5;
	/** 提交人 **/
	String owner;
	/** 目录,相对于基目录 **/
	String folder;
	/** 文件名, 不带路径 **/
	String name;
	/** 路径,带目录和文件名 **/
	String location;
	/** 读取出来的文件 **/
	FileReader fileReader;
	File file;
	
	String encoding;

	/** 最后修改时间 **/
	Timestamp lastModified;
	
	/** 提示级别信息 **/
	List<String> infos;
	/** 警告级别信息 **/
	List<String> warns;
	/** 错误级别信息 **/
	List<String> errors;
	
	
	Integer affectRowCnt;
	Timestamp execBegin;
	Timestamp execEnd;
	
	
	YTSqlCheckerItem itemModel;
	YTSqlfile fileModel;
	
	/** 错误类型 */
	Integer datatype;
	
	
	String objectName;
	/** 提交日期 **/
	Timestamp date;
	
	Integer len;
	
	// 如果=2已处理,就不再报任何异常
	Integer status;
	
	public Integer getStatus() {
		return status;
	}
	public WSqlFile setStatus(Integer status) {
		this.status = status;
		return this;
	}
	public Integer getLen() {
		return len;
	}
	public WSqlFile setLen(Integer len) {
		this.len = len;
		return this;
	}
	public WSqlFile setLen(Long len) {
		return this.setLen(len != null ? len.intValue() : 0);
	}
	public Timestamp getDate() {
		return date;
	}
	public WSqlFile setDate(Timestamp date) {
		this.date = date;
		return this;
	}
	public String getObjectName() {
		return objectName;
	}
	public WSqlFile setObjectName(String objectName) {
		this.objectName = objectName;
		return this;
	}
	public Integer getDatatype() {
		return datatype;
	}
	public WSqlFile setDatatype(Integer datatype) {
		this.datatype = datatype;
		return this;
	}
	public YTSqlCheckerItem getItemModel() {
		return itemModel;
	}
	public WSqlFile setItemModel(YTSqlCheckerItem itemModel) {
		this.itemModel = itemModel;
		return this;
	}
	public YTSqlfile getFileModel() {
		return fileModel;
	}
	public WSqlFile setFileModel(YTSqlfile fileModel) {
		this.fileModel = fileModel;
		return this;
	}
	public Timestamp getExecBegin() {
		return execBegin;
	}
	public WSqlFile setExecBegin(Timestamp execBegin) {
		this.execBegin = execBegin;
		return this;
	}
	public Timestamp getExecEnd() {
		return execEnd;
	}
	public WSqlFile setExecEnd(Timestamp execEnd) {
		this.execEnd = execEnd;
		return this;
	}
	public Integer getAffectRowCnt() {
		return affectRowCnt;
	}
	public WSqlFile setAffectRowCnt(Integer affectRowCnt) {
		this.affectRowCnt = affectRowCnt;
		return this;
	}
	public Integer getId() {
		return id;
	}
	public WSqlFile setId(Integer id) {
		this.id = id;
		return this;
	}
	public String getMd5() {
		return md5;
	}
	public WSqlFile setMd5(String md5) {
		this.md5 = md5;
		return this;
	}
	public String getOwner() {
		return owner;
	}
	public WSqlFile setOwner(String owner) {
		this.owner = owner;
		return this;
	}
	public String getFolder() {
		return folder;
	}
	public WSqlFile setFolder(String folder) {
		this.folder = folder;
		return this;
	}
	public String getName() {
		return name;
	}
	public WSqlFile setName(String name) {
		this.name = name;
		return this;
	}
	public String getLocation() {
		return location;
	}
	public WSqlFile setLocation(String location) {
		this.location = location;
		return this;
	}
	public String getEncoding() {
		return encoding;
	}
	public WSqlFile setEncoding(String encoding) {
		this.encoding = encoding;
		return this;
	}
	public Timestamp getLastModified() {
		return lastModified;
	}
	public WSqlFile setLastModified(Timestamp lastModified) {
		this.lastModified = lastModified;
		return this;
	}
	public List<String> getInfos() {
		return infos;
	}
	public WSqlFile setInfos(List<String> infos) {
		this.infos = infos;
		return this;
	}
	public List<String> getWarns() {
		return warns;
	}
	public WSqlFile setWarns(List<String> warns) {
		this.warns = warns;
		return this;
	}
	public List<String> getErrors() {
		return errors;
	}
	public WSqlFile setErrors(List<String> errors) {
		this.errors = errors;
		return this;
	}
	public FileReader getFileReader() {
		return fileReader;
	}
	public WSqlFile setFileReader(FileReader fileReader) {
		this.fileReader = fileReader;
		return this;
	}
	public File getFile() {
		return file;
	}
	public WSqlFile setFile(File file) {
		this.file = file;
		return this;
	}
	
	
}
